<?php

namespace Sensio\Bundle\HangmanBundle\Tests\Game;

use Sensio\Bundle\HangmanBundle\Game\GameContext;
/**
 * Description of GameContextTest
 *
 * @author DIDM4
 */
class GameContextTest extends \PHPUnit_Framework_TestCase
{
    public function testLoadTheGame()
    {
        $data = array(
            "word" => "php",
            "attempts" => 1,
            "tried_letters" => array('p','x'),
            "found_letters" => array('p'),
        );
        
        $session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
        $session->expects($this->once())
                ->method('get')
                ->with('hangman')
                ->will($this->returnValue($data));
        $context = new GameContext($session);
        
        $this->assertInstanceOf(
                'Sensio\Bundle\HangmanBundle\Game\Game', 
                $context->loadGame());
    }

}